import { App } from 'vue'
import { isH5 } from '@/utils/device'

// H5端使用vant
import Vant from 'vant'
import 'vant/lib/index.css'

// Web端使用element-plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 导入所有图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

export function setupUI(app: App) {
  if (isH5()) {
    app.use(Vant)
  } else {
    app.use(ElementPlus)
    // 注册所有图标
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  }
} 